home *** CD-ROM | disk | FTP | other *** search
- Path: news.tu-chemnitz.de!news
- From: hfst@hrz.tu-chemnitz.de (Hans Steffani)
- Newsgroups: comp.lang.c
- Subject: Re: sscanf problems
- Date: 24 Jan 96 08:09:57 GMT
- Organization: University of Technology Chemnitz, FRG
- Message-ID: <4e4qf8$rea@pyrrhus-f.hrz.tu-chemnitz.de>
- References: <4e4c2v$j2g@mathserv.mps.ohio-state.edu>
- NNTP-Posting-Host: prom.hrz.tu-chemnitz.de
-
- Chris Mongold <cmongold@magnus.acs.ohio-state.edu> writes:
-
- >#include <stdio.h>
-
- >void main()
- >{
- >char input[20], crap[17], segment[6], seg_len[3], begin[3], load[3];
- >int type;
-
- >sscanf(crap, "%d%3s%6s%3s%3s", type, begin, segment, seg_len, load);
-
- You have to pass an pointer to an int instead the int variable
- itsself.
-
- The char arrays begin, seg_len and load need 4 elements to hold
- a 3 character long string and segment needs 7 to hold a 6
- element string.
-
- h.f.s.
- PS:
- This is posted and mailed.
- --
- Hans Friedrich Steffani
- Institut fuer Elektrische Maschinen und Antriebe
- TU Chemnitz-Zwickau
- e-mail: hans.steffani@e-technik.tu-chemnitz.de
-